<template>
  <div class="back-box coms-live-iframe-none" v-if="recommendLiveInfo" @click="clickBackLive">
    <div class="c-flex-row c-aligni-end c-hh14">
      <span class="c-hh8 audio-icon icon1"></span>
      <span class="c-hh14 audio-icon icon2"></span>
      <span class="c-hh12 audio-icon icon3"></span>
      <span class="c-hh10 audio-icon"></span>
    </div>
    <span class="c-ml10">回直播间</span>
    <i @click.stop="clickCloseTip" class="iconfont c-fs16 c-fc-sgray c-ph10 c-pv10">&#xe8fd;</i>
  </div>
</template>
<script>
import { mapState } from "vuex";
export default {
  name: "backToLive",
  props: {
  },
  computed: {
    ...mapState({
       recommendLiveInfo:state => state.live.recommendLiveInfo
    })
  },
  data() {
    return {
    }
  },
  mounted() {
    let goLivePath = sessionStorage.getItem('setRecommendLiveInfo');
    if (goLivePath) {
       this.$store.commit("live/setRecommendLiveInfo", goLivePath);
    }
  },
  methods: {
    clickCloseTip() {
       this.$store.commit("live/setRecommendLiveInfo", null);
    },
    clickBackLive() {
      this.$routerGo(this, "push", { path: this.recommendLiveInfo });
    }
  }
}
</script>
<style scoped>
.back-box{
  position: fixed;
  right: 0;
  bottom: 2.5rem;
  z-index: 999999;
  height: 1.6rem;
  background: rgba(255,255,255,0.90);
  border-radius: 0.8rem 0 0 0.8rem;
  box-shadow: 0 0 0.75rem 0 rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  color: #248AFD;
  font-size: 0.55rem;
  padding-left: 0.5rem;
}
.audio-icon {
  width: 2px;
  background: #248AFD;
  border-radius: 1px;
  animation: play 2s infinite;
}
.icon1 {
  animation: play 2s 0.5s infinite;
}
.icon2 {
  margin: 0 0.1rem;
  animation: play 2s 1s infinite;
}
.icon3 {
  margin-right: 0.1rem;
  animation: play 2s 1.5s infinite;
}
@keyframes play {
  0% {
    height: 100%;
  }
  50% {
    height: 40%;
  }
  100% {
    height: 100%;
  }
}
</style>
